Skip to content

Allow to override joint friction coefficients during parsing #443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

flferretti
Copy link
Collaborator

@flferretti flferretti commented Jun 5, 2025

This pull request introduces new configuration options for joint dynamics and updates the parser to utilize these options. It adds environment variables for static and viscous friction coefficients and modifying the parser to use these variables as defaults.

  • No friction
single_pendulum.mp4
  • Viscous friction
single_pendulum_viscous.mp4
  • Static friction
single_pendulum_static.mp4

📚 Documentation preview 📚: https://jaxsim--443.org.readthedocs.build//443/

@flferretti flferretti self-assigned this Jun 5, 2025
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 5d9f347 Previous: 8d5c896 Ratio
tests/test_benchmark.py::test_forward_dynamics_aba[1] 33.79421803946359 iter/sec (stddev: 0.00013320845216280286) 33.99270710150131 iter/sec (stddev: 0.00009160345295732999) 1.01
tests/test_benchmark.py::test_forward_dynamics_aba[128] 15.676597399540748 iter/sec (stddev: 0.0018073541705346983) 15.450388973393041 iter/sec (stddev: 0.00039276707628969594) 0.99
tests/test_benchmark.py::test_free_floating_bias_forces[1] 26.975026261440025 iter/sec (stddev: 0.0007140936830906702) 28.072185819254948 iter/sec (stddev: 0.0001405275314719085) 1.04
tests/test_benchmark.py::test_free_floating_bias_forces[128] 11.416051116137742 iter/sec (stddev: 0.0007799023224264016) 10.661461909768686 iter/sec (stddev: 0.0003774590436268307) 0.93
tests/test_benchmark.py::test_forward_kinematics[1] 79.12102777365898 iter/sec (stddev: 0.000194739578509015) 80.47867539657375 iter/sec (stddev: 0.0008406595365800215) 1.02
tests/test_benchmark.py::test_forward_kinematics[128] 24.284734156800447 iter/sec (stddev: 0.00028644241819545914) 22.963981536068786 iter/sec (stddev: 0.00018004443135162003) 0.95
tests/test_benchmark.py::test_free_floating_mass_matrix[1] 39.1017548047529 iter/sec (stddev: 0.0013547763804221203) 41.68963883859595 iter/sec (stddev: 0.00016661815474607527) 1.07
tests/test_benchmark.py::test_free_floating_mass_matrix[128] 40.18779142826938 iter/sec (stddev: 0.0002944570016007363) 41.30544074968093 iter/sec (stddev: 0.00006869051943032785) 1.03
tests/test_benchmark.py::test_free_floating_jacobian[1] 52.15084959992029 iter/sec (stddev: 0.0008169075386156784) 54.710482035025365 iter/sec (stddev: 0.0000771513049637593) 1.05
tests/test_benchmark.py::test_free_floating_jacobian[128] 53.108449838366965 iter/sec (stddev: 0.00037879122300275777) 54.13600959838642 iter/sec (stddev: 0.0002066391631624143) 1.02
tests/test_benchmark.py::test_free_floating_jacobian_derivative[1] 31.337542895144622 iter/sec (stddev: 0.00018178353234253524) 32.31611675089207 iter/sec (stddev: 0.0004465427329110755) 1.03
tests/test_benchmark.py::test_free_floating_jacobian_derivative[128] 32.17043130219589 iter/sec (stddev: 0.00024451877748001374) 32.8020875749547 iter/sec (stddev: 0.00027199927237599305) 1.02
tests/test_benchmark.py::test_soft_contact_model[1] 29.739341729147903 iter/sec (stddev: 0.0001240519709365969) 30.416550779490947 iter/sec (stddev: 0.00009594224392172117) 1.02
tests/test_benchmark.py::test_soft_contact_model[128] 14.62358246204123 iter/sec (stddev: 0.0002523029961964484) 14.145201786398033 iter/sec (stddev: 0.0005232496065842119) 0.97
tests/test_benchmark.py::test_rigid_contact_model[1] 6.200263364610651 iter/sec (stddev: 0.0005353750032472616) 6.438860629793804 iter/sec (stddev: 0.00028284443651919447) 1.04
tests/test_benchmark.py::test_rigid_contact_model[128] 0.8424954590908521 iter/sec (stddev: 0.0008692382868190488) 0.8450260471582455 iter/sec (stddev: 0.0007584783160614406) 1.00
tests/test_benchmark.py::test_relaxed_rigid_contact_model[1] 5.763411333401567 iter/sec (stddev: 0.00039327399281458713) 5.901695040090421 iter/sec (stddev: 0.0008691354003239028) 1.02
tests/test_benchmark.py::test_relaxed_rigid_contact_model[128] 3.3833758423910996 iter/sec (stddev: 0.0009477039516693447) 3.3393481643233303 iter/sec (stddev: 0.0005133033064496388) 0.99
tests/test_benchmark.py::test_simulation_step[1] 4.621481936262838 iter/sec (stddev: 0.004031185772787822) 4.792670117574774 iter/sec (stddev: 0.00041546735946859745) 1.04
tests/test_benchmark.py::test_simulation_step[128] 2.648350474968521 iter/sec (stddev: 0.000525946625231596) 2.6082535675050296 iter/sec (stddev: 0.0013605955461495007) 0.98

This comment was automatically generated by workflow using github-action-benchmark.

@flferretti flferretti marked this pull request as ready for review June 13, 2025 08:52
@flferretti flferretti requested a review from xela-95 as a code owner June 13, 2025 08:52
@@ -47,10 +47,21 @@ Joint Dynamics
~~~~~~~~~~~~~~
Joint dynamics are configured using environment variables starting with ``JAXSIM_JOINT_``. Available variables include:

- ``JAXSIM_JOINT_FRICTION_STATIC``: Overrides the static friction coefficient for all joints.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the decision to put them as env variables?

These values should be dependent on the model. I am not convinced of having the default set via env variables.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should be dependent on the model, but instead of modifying the URDF, this allows to override them quickly. The default behavior does not change if the variable is not set

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants